<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/common/taglibs.jsp"%>
<!DOCTYPE html>
<html class="ng-app:myApp" id="ng-app" ng-app="myApp" xmlns:ng="http://angularjs.org">
<head>
<title>司机信息管理</title>
<%@ include file="/WEB-INF/common/meta.jsp"%>
<%@ include file="/WEB-INF/layouts/global_res_header.jsp"%>
</head>

<body ng-controller="driverCtrl">
	<div id="mainDataBlock" ng-grid="gridOptions"></div>
	<div id="funcBlock" class="alert alert-info">
		<div class="btn-group btn-group-sm">
			<button type="button" class="btn btn-default" ng-click="onOpenQueryFormModal()">
				<span class="glyphicon glyphicon-search"></span> 查询
			</button>
			<button type="button" class="btn btn-default" ng-click="refresh()">
				<span class="glyphicon glyphicon-refresh"></span> 刷新
			</button>
			<shiro:hasPermission name="oms:driver:import">
			<button type="button" class="btn btn-default" ng-click="onOpenImportFormModal()">
				<span class="glyphicon glyphicon-import"></span> 导入
			</button>
			</shiro:hasPermission>
			<shiro:hasPermission name="oms:driver:export">
			<button type="button" class="btn btn-default" ng-click="onOpenExportFormModal()">
				<span class="glyphicon glyphicon-export"></span> 导出
			</button>
			</shiro:hasPermission>
		</div>
	</div>
</body>
	
<div id="queryFormModal" class="modal" tabindex="-1" data-width="400px">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
		<h4 class="modal-title">查询</h4>
	</div>
	<div class="modal-body">
		<div class="row">
			<div class="col-md-12">
				<form name="queryFormForm" class="form-inline" role="form">	
					<div class="form-group">
						<label for="name">名称</label> 
						<input name="name" ng-model="queryForm.name" class="form-control" placeholder="名称">		
					</div>								
					<div class="form-group">
						<label for="st">状态</label>
						<select name="st" ui-select2="{width:'150px', allowClear:'true'}" ng-model="queryForm.st" class="select2" data-placeholder="状态">
							<option value=""></option>
							<option ng-repeat="st in stList" value="{{st.id}}">{{st.lb}}</option>
						</select>
					</div>
				</form>
			</div>
		</div>
	</div>
	<div class="modal-footer">
		<button type="button" data-dismiss="modal" class="btn btn-default">关闭</button>
		<button ng-click="onQuery()" ng-disabled="queryFormForm.$invalid" class="btn btn-default">查询</button>
	</div>
</div>

<div id="editFormModal" class="modal" tabindex="-1" data-width="580px">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
		<h4 class="modal-title">编辑</h4>
	</div>
	<div class="modal-body">
		<div class="row">
			<div class="col-md-12">
				<form name="editFormForm" class="form-horizontal" role="form" novalidate>
					<div class="form-group hidden">
						<label for="id" class="col-sm-4 control-label">ID</label> 
						<div class="col-sm-5">
							<input type="hidden" name="id" ng-model="editForm.id" class="form-control">		
						</div>
					</div>
					<div class="row">
						<div class="col-sm-5">	
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="spancss">*</span>工号： <input name="cd" ng-model="editForm.cd" required class="form-control" placeholder="工号">
						</div>
						<div class="col-sm-5">
							<span class="spancss">*</span>名称： <input name="name" ng-model="editForm.name" required class="form-control" placeholder="名称">		
						</div>					
					</div>
					<div class="row top">
						<div class="col-sm-5">	
							&nbsp;&nbsp;&nbsp;&nbsp;身份证： <input name="idcard" ng-model="editForm.idcard" class="form-control" placeholder="身份证">
						</div>
						<div class="col-sm-5">	
							&nbsp;&nbsp;电话： <input name="phone" ng-model="editForm.phone" class="form-control" placeholder="电话">
						</div>										
					</div>
					<div class="row top">	
						<div class="col-sm-5">
							驾照类型： <input name="driverType" ng-model="editForm.driverType" class="form-control" placeholder="驾照类型" >		
						</div>						
						<div class="col-sm-5">
							<span class="spancss">*</span>状态： <select name="st" ng-required="true" ui-select2="{width:'150px', allowClear:'true'}"  ng-model="editForm.st" class="select2" data-placeholder="状态">						
								<option value=""></option>
								<option ng-repeat="st in stList" value="{{st.id}}">{{st.lb}}</option>
							</select>	
						</div>					
					</div>
				</form>
			</div>
		</div>
	</div>
	<div class="modal-footer">
		<button type="button" data-dismiss="modal" class="btn btn-default">关闭</button>
		<button ng-click="onSaveEditForm()" ng-disabled="editFormForm.$invalid" class="btn btn-default">提交</button>
	</div>
</div>

<div id="importFormModal" class="modal" tabindex="-1" data-width="400px" style="display: none;">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
		<h4 class="modal-title">导入</h4>
	</div>
	<div class="modal-body">
		<div class="row">
			<div class="col-md-12">
				<form name="importFormForm" action="{{importForm.importUrl}}" target="_blank" method="post" enctype="multipart/form-data" class="form-horizontal" role="form">
					<div class="form-group">
						<div class="col-sm-8">
						<input name="importUrl" id="importUrl" ng-required="true" ng-model="importForm.importUrl" class="form-control" placeholder="导入" style="display: none;">
						</div>
					</div>
					<div class="form-group">
						<label for="file" class="col-sm-3 control-label">文件</label>
						<div style="float: left;margin-right: 10px;">
							<input type="file" name="file" class="form-control">
						</div>
						<div style="float: left;" >
							<button ng-click="onExportTemplate()" type="button" class="btn btn-success" style="height: 30px;padding: 4px 6px;">下载模板</button>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
	<div class="modal-footer">
		<button type="button" data-dismiss="modal" class="btn btn-default">关闭</button>
		<button type="button" ng-disabled="importFormForm.$invalid" ng-click="onImport()" class="btn btn-primary">导入</button>
	</div>
</div>

<div class="contextMenu" id="menu">
	<ul>
		<li id="find" ng-click="onOpenQueryFormModal()">
		 <img src=""/> 
		&nbsp;查询&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
		<li id="refresh" ng-click="refresh()">
		 <img src=""/> 
		&nbsp;刷新&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
		<shiro:hasPermission name="oms:driver:add">
		<li id="save" ng-click="onOpenEditFormModal('add')">
		 <img src=""/> 
		&nbsp;增加&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
		</shiro:hasPermission>
		<shiro:hasPermission name="oms:driver:del">
		<li id="del" ng-click="onOpenDelFormModal()">
		 <img src=""/> 
		&nbsp;停用&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
		</shiro:hasPermission>
		<shiro:hasPermission name="oms:driver:upd">
		<li id="edit" ng-click="onOpenEditFormModal('upd')">
		 <img src=""/> 
		&nbsp;编辑&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
		</shiro:hasPermission>
	</ul>
</div>
<%@ include file="/WEB-INF/layouts/global_res_footer.jsp"%>
<script type="text/javascript" src="${ctx}/res_oms/oms/driver.js"></script>
<script type="text/javascript" src="${ctx}/res_oms/jquery.contextmenu.r2.js"></script> 
</html>
